package com.rpframework.module.common.bottom.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rpframework.module.common.bottom.entity.Menu;
import com.rpframework.module.common.bottom.mapper.MenuMapper;
import com.rpframework.module.common.bottom.service.MenuService;

import tk.mybatis.mapper.entity.Example;

/**
 * 菜单数据表服务接口实现类 ClassName:MenuServiceImpl <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON(可选). <br/>
 * Date: 2016年4月13日 下午1:34:52 <br/>
 *
 * @author Qiu ChengBing 745656220@qq.com
 * @since JDK 1.7
 */
@Service
public class MenuServiceImpl extends BaseServiceImpl<Menu> implements MenuService {

    public final Logger log = LoggerFactory.getLogger(getClass());

    private MenuMapper menuMapper;

    @Autowired
    MenuServiceImpl(MenuMapper mapper) {
        super(mapper);
        this.menuMapper = mapper;
    }

    @Override
    public Example getExample() {
        return new Example(Menu.class);
    }

    /**
     * 查询最后一条数据的菜单 TODO 简单描述该方法的实现功能（可选）.
     */
    @Override
    public Menu findMenu() {
        // TODO Auto-generated method stub
        return menuMapper.findMenu();

    }

    /**
     * 删除最后一条数据的菜单 TODO 简单描述该方法的实现功能（可选）.
     */
    @Override
    public int deleteMenu() {
        // TODO Auto-generated method stub
        return menuMapper.deleteMenu();
    }

}
